import {init} from "snabbdom/src/package/init";
import {h} from "snabbdom/src/package/h";

let patch = init([]);

let vnode = h('div#container', [
    h('h1', 'Hello Snabbdom'),
    h('p', 'This is a tag called P.')
])

let app = document.querySelector('#app')

let oldVnode = patch(app, vnode)

setTimeout(() => {
    vnode = h('div#container', [
        h('h1', 'Hello World'),
        h('p', 'Hello P')
    ])
    patch(oldVnode, vnode)

    //clear elements of single page
    patch(oldVnode, h('!'))
}, 2000)